package com.thyme.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.thyme.system.dao.Iec61850DataInstDao;
import com.thyme.system.service.Iec61850DataInstService;
import com.thyme.system.vo.Iec61850DataInstVo;
import com.thyme.system.vo.Iec61850NodeDataVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author nana
 * @since 2021-03-17
 */
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class Iec61850DataInstServiceImpl implements Iec61850DataInstService {
    private final Iec61850DataInstDao iec61850DataInstDao;

    @Override
    public void deleteByConfigId(Integer id) {
        iec61850DataInstDao.deleteByIec61850IedInstId(id);
    }

    @Override
    public int insert(Iec61850DataInstVo iec61850DataInstVo) {
        return iec61850DataInstDao.insert(iec61850DataInstVo);
    }

    @Override
    public IPage<Iec61850NodeDataVo> getAll(Page page, Integer iedId) {
        return iec61850DataInstDao.getAll(page,iedId);
    }

}
